<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets" 
          
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>
    </h:head>
    <h:body>
        <ui:composition template="template/masterlayout.xhtml">
            <ui:define name="pagetitle">
                Users management
            </ui:define>
            <ui:define name="breadcrumb">
                <h:link value="Dashboard" outcome="index"/> &raquo; <h:link value="Users management" outcome="users"/>
            </ui:define>
            <ui:define name="content">
                <div class="alert-box #{userPatientAdminBean.messageStyle}"><span>#{userPatientAdminBean.messageStyle} </span>#{userPatientAdminBean.message}</div>
                <h:form>
                    <h:dataTable value="#{userPatientAdminBean.userPatients}" var="userPatient" columnClasses="patientID,userName,action">
                        <h:column>
                            <f:facet name="header">Patient ID</f:facet>
                            #{userPatient.patientID}
                        </h:column>
                        <h:column>
                            <f:facet name="header">User Name</f:facet>
                            #{userPatient.userName}                            
                        </h:column>
                        <h:column>
                            <f:facet name="header">Action</f:facet>
                            <h:link styleClass="view" value="View" outcome="user">
                                <f:param name="userName" value="#{userPatient.userName}"/>
                            </h:link>
                            <h:link styleClass="edit" value="Edit" outcome="edituser">
                                <f:param name="userName" value="#{userPatient.userName}"/>
                            </h:link>
                            <h:commandLink styleClass="delete" value="Delete" action="#{userPatientAdminBean.deleteUser(userPatient.userName)}"></h:commandLink>
                        </h:column>
                    </h:dataTable>
                </h:form>
            </ui:define>
        </ui:composition>
    </h:body>
</html>

